<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="antsj" uri="/struts-ant-jquery-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <antsj:head jqgrid="true" />
</head>

<body>

  <script type="text/javascript">
  jQuery(document).ready(function(){ 
    jQuery("#list").jqGrid({
    	url:'/stat/test/jsonuser',
        datatype: "json",
        mtype: 'GET',
      colNames:['用户名','中文名'],
      colModel :[ 
        {name:'username', index:'username', width:100, editable:true,formatter:usernameFormater}, 
        {name:'localName', index:'localName', width:100} 
      ],
      pager:'#pager',
      rowNum:10,
      rowList:[10,20,30],
      sortname: 'username',
      sortorder: 'desc',
      viewrecords: true,
      caption: '用户管理',
      width:'700',
      height:'400'      
    }); 
  }); 

  
  </script>
  
  <script type="text/javascript">
  function usernameFormater(cellvalue ,options,rowObject){
	      //alert(cellvalue);
          return "<span style='color:red;font-weight:bold'>"+cellvalue+"</span>";
 } 
  </script>
  <div id="jqgrid">
   <table id="list"></table>
<div id="pager"></div>
</div>

<antsj:grid id="list1" url="test/jsonuser" gridModel="gridModel" />
<script type="text/javascript">
jQuery(document).ready(function(){
	function localNameFormatter (cellvalue, options, rowObject ) 
	{
		return cellvalue;
	}	

	function usernameFormatter (cellvalue, options, rowObject ) 
	{
		return cellvalue;
	}			
	})
</script>
</body>
</html>
